<?php

namespace App\Models\Live;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ShopMemberAccountModel extends Model
{
    use HasFactory;
    protected $connection="shop";
    protected $table="member_account";
    public $timestamps = false;
    protected $guarded=[];
    public static function make($data){
        $log = [
                'member_id' => $data['member_id'],//require
                'account_type' => $data['account_type']??'point',
                'account_data' => $data['account_data']??null,//require
                'from_type' => $data['from_type']??'adjust',
                'type_name' => $data['type_name' ] ?? '调整',
                'type_tag' => $data['relate_tag']??'0',
                'create_time' => time(),
                'username' => $data['username' ] ?? null,//require
                'mobile' => $data['mobile' ] ?? null,//require
                'email' => $data['email' ] ?? null,//require
                'remark' => $data['remark'] ?? '直播间积分抽取活动奖励'
        ];
        return self::create($log);
    }
}
